package com.atguigu.gmall.pms.mapper;


import com.atguigu.gmall.pms.entity.SkuAttrValueEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * sku销售属性&值
 * SELECT sku_id,GROUP_CONCAT(attr_value ORDER BY attr_id ASC)AS attr_values
 * FROM pms_sku_attr_value
 * WHERE sku_id IN (22,23) GROUP BY sku_id
 * @author 嘉岭月天
 * @email 嘉岭月天@cnnc.com
 * @date 2021-11-29 18:03:20
 */
@Mapper
public interface SkuAttrValueMapper extends BaseMapper<SkuAttrValueEntity> {

    // 通过条件集合skuIds 获取
    // mapList = [{sku_id=22, attr_values=白色,8G,256G}, {sku_id=23, attr_values=白色,12G,256G}]
    List<Map<String, Object>> queryMappingBySkuIds(@Param("skuIds") List<Long> skuIds);
	
}
